package parser;

import antlr.RecognitionException;
import java.util.*;

public class ImportStmt extends Stmt {
    
    Expr module_name;
    int as_name;

    public ImportStmt(Expr module_name, int as_name) { 
        this.module_name = module_name;
        this.as_name = as_name;
    }
    
    void write(ByteStream out) throws RecognitionException {
        module_name.write(out);
        out.write(Opcodes.IMPORT);
        out.write(Opcodes.STORE_GLOBAL);
        out.writeShort(as_name);
    }

}
